﻿using JamesZhao.Engine.Graphics.Visuals;
using SlimDX.DXGI;

namespace JamesZhao.Engine.Graphics.RenderStages.Old
{
    public class RenderAllStage : RenderStage
    {
        public override string Name
        {
            get { return "Render All Stage"; }
        }

        protected override void OnRender(GraphicsDevice device, SwapChain swapChain, VisualsList visualsList,
                                         Camera camera)
        {
            device.ImmediateContext.OutputMerger.SetTargets(FinalDepthSurface.DepthView, FinalColorSurface.TargetView);
            foreach (Drawable renderable in visualsList.Drawables)
            {
                renderable.Render(device, camera);
            }
        }
    }
}